
<script type="text/javascript" src="<?= APPLICATION_SITEADMIN_URL ?>fckeditor/fckeditor.js"></script>
<script type="text/javascript" src="<?= APPLICATION_SITEADMIN_URL ?>fckeditor/ewp.js"></script>
<script type="text/javascript">
<!--
    _width_multiplier = 16;
    _height_multiplier = 30;
    var EW_DHTMLEditors = [];
    function EW_UpdateTextArea() {
        if (typeof EW_DHTMLEditors != 'undefined') {
            if (FCKeditorAPI) {
                var inst;
                for (inst in FCKeditorAPI.__Instances)
                    FCKeditorAPI.__Instances[inst].UpdateLinkedField();
            }
        }
    }

//-->


</script>
<?
$mod = $_GET['mod'];
$id = 1;

$db = new MySQL();
$table = "common";
$sql = $db->select("select * from $table where id='$id'");
if ($db->numrows($sql) > 0)
    $te = $db->fetch($sql);
$db->close();
$title_add = '"Title page"';
?>
<script type="text/JavaScript">
    function checkinput()
    {
    return true;
    }

    function save(id)
    {
    var frm=document.frmedit;		
    if(checkinput())
    {
    frm.action="?mod=<?= $mod ?>&act=process&id="+id;;
    frm.method="POST";
    frm.submit();
    }
    }

    function resetfrom()
    {
    document.frmedit.reset();

    }
</script>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td align="left" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="34"><img src="<?= APPLICATION_SITEADMIN_URL ?>images/cor_data_top_l.gif" alt="tl" width="34" height="19" /></td>
                    <td class="toptborder">&nbsp;</td>
                    <td width="20"><img src="<?= APPLICATION_SITEADMIN_URL ?>images/cor_data_top_r.gif" alt="tr" /></td>
                </tr>
            </table></td>
    </tr>
    <tr>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="10" class="leftborder">&nbsp;</td>
                    <td><table width="100%" border="0" cellpadding="0" cellspacing="2" class="dataBack">
                            <tr>
                                <td width="55%" height="36" class="titleOrange"><?= $title_add ?></td>
                                <td align="right" valign="middle" class="titleOrange">&nbsp;</td>
                            </tr>
                            <tr>
                                <td height="7" colspan="2" background="images/cor_data_line1.gif"></td>
                            </tr>
                            <tr>
                            <form name="frmedit" method="post" enctype="multipart/form-data" onsubmit="return checkinput();">
                                <td  colspan="2" ><table width="100%" border="0" cellspacing="0">									  
                                        <tr>
                                            <td width="19%" align="right" valign="top">Page Title : </td>
                                            <td ><input name="titlepage" type="text" class="form_0" value="<?= $te['titlepage'] ?>" ></td>
                                        </tr>	

                                        <tr>
                                            <td align="right" valign="top">Page Title (Vietnamese) : </td>
                                            <td ><input name="titlepage_vn" type="text" class="form_0" value="<?= $te['titlepage_vn'] ?>" ></td>
                                        </tr>

                                        <tr>
                                            <td width="19%" align="right" valign="top">Facebook: </td>
                                            <td ><input name="facebook" type="text" class="form_0" value="<?= $te['facebook'] ?>" ></td>
                                        </tr>


                                        <tr>
                                            <td align="right" valign="top">Footer : </td>
                                            <td align="left" valign="middle">
                                                <SPAN class=hideTrigger><span id="aaa" onClick="changeColor('aaa')">English</span></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;
                                                <SPAN class=hideTrigger><span id="bbb" onClick="changeColor('bbb')">Vietnamese</span></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;

                                                <DIV  class=hideBlock id="aaa_s">
                                                    <P>
                                                        <textarea name="copyright" class="form_2"><?= $te['copyright'] ?></textarea>
                                                        <script type="text/javascript">
    var editor = new EW_DHTMLEditor("copyright");
    editor.create = function() {
        var sBasePath = '<?= APPLICATION_SITEADMIN_URL ?>fckeditor/';
        var oFCKeditor = new FCKeditor('copyright', 40 * _width_multiplier, 5 * _height_multiplier);
        oFCKeditor.BasePath = sBasePath;
        oFCKeditor.ReplaceTextarea();
        this.active = true;
    }
    EW_DHTMLEditors[EW_DHTMLEditors.length] = editor;
                                                        </script>		
                                                    </P></DIV>


                                                <DIV  class=hideBlock id="bbb_s">
                                                    <P>
                                                        <textarea name="copyright_vn" class="form_2"><?= $te['copyright_vn'] ?></textarea>
                                                        <script type="text/javascript">
                                                            var editor = new EW_DHTMLEditor("copyright_vn");
                                                            editor.create = function() {
                                                                var sBasePath = '<?= APPLICATION_SITEADMIN_URL ?>fckeditor/';
                                                                var oFCKeditor = new FCKeditor('copyright_vn', 40 * _width_multiplier, 5 * _height_multiplier);
                                                                oFCKeditor.BasePath = sBasePath;
                                                                oFCKeditor.ReplaceTextarea();
                                                                this.active = true;
                                                            }
                                                            EW_DHTMLEditors[EW_DHTMLEditors.length] = editor;
                                                        </script>					
                                                    </P>
                                                </DIV>		


                                                <script type="text/javascript">
                                                    changeColor('aaa');
                                                </script>				
                                            </td>
                                        </tr>	

                                        <tr>
                                            <td width="23%" align="right" valign="top">Google Code : </td>
                                            <td >
                                                <textarea name="googlecode" cols="77" rows="10" ><?= $te['googlecode'] ?></textarea>					</td>
                                        </tr>

                                        <tr>
                                            <td align="right" valign="top">Keywords : </td>
                                            <td align="left" valign="middle">
                                                <textarea name="meta_key" class="form_3" ><?= $te['meta_key'] ?></textarea>					</td>
                                        </tr> 
                                        <tr>
                                            <td align="right" valign="top">Description : </td>
                                            <td align="left" valign="middle">
                                                <textarea name="meta_des" class="form_3"><?= $te['meta_des'] ?></textarea>					</td>
                                        </tr> 

                                        <tr>
                                            <td width="23%" height="35" align="right" valign="top">&nbsp;</td>
                                            <td align="left" valign="middle">
                                                <img src="images/icons/save.png" onClick="save(<?= $id ?>);" class="pointer" />  &nbsp;
                                                <img src="images/icons/reset.png" onClick="resetfrom();" class="pointer" /></td>
                                        </tr>
                                    </table>
                                    <input type="hidden" name="form_" value="edit">
                                </td>
                            </form>
                </tr>
            </table>
        </td>
        <td width="10" class="rightborder">&nbsp;</td>
    </tr>
</table></td>
</tr>
<tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataBack">
            <tr>
                <td width="34"><img src="<?= APPLICATION_SITEADMIN_URL ?>images/cor_data_bot_l.gif" alt="bl" /></td>
                <td class="botborder" >&nbsp;</td>
                <td width="19"><img src="<?= APPLICATION_SITEADMIN_URL ?>images/cor_data_bot_r.gif" alt="br" /></td>
            </tr>
        </table></td>
</tr>
</table>

<script type="text/javascript">
<!--
                                                    EW_createEditor();  // Create DHTML editor(s)

//-->
</script>